﻿<ListBox x:Class="Nizm0.QOT.Library.Controls.ObejctList"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
            xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
            xmlns:local="clr-namespace:ThreadingComponent"
            xmlns:local2="clr-namespace:DesignInControl"
            xmlns:my="clr-namespace:Nizm0.QOT.Library.Controls"
            mc:Ignorable="d"
            d:DesignHeight="410" d:DesignWidth="218" DataContext="{Binding context}" SelectionMode="Extended" ContextMenuOpening="ListBox_ContextMenuOpening" ContextMenuService.ShowOnDisabled="True"
            MouseDown="someListBox_MouseDown"
            Focusable="True">
    <ListBox.Resources>
        <CollectionViewSource x:Key="SortedItems" Source="{Binding Name}">
            <CollectionViewSource.SortDescriptions>
                <scm:SortDescription PropertyName="Name"/>
            </CollectionViewSource.SortDescriptions>
        </CollectionViewSource>
    </ListBox.Resources>
    <ListBox.CommandBindings>
        <CommandBinding
    	    Command="ApplicationCommands.Cut"
    	    Executed="CutCommandHandler"
    	    CanExecute="CanCutExecuteHandler" />
        <CommandBinding
    	    Command="ApplicationCommands.Copy"
    	    Executed="CopyCommandHandler"
    	    CanExecute="CanCopyExecuteHandler" />
        <CommandBinding
    	    Command="ApplicationCommands.Paste"
    	    Executed="PasteCommandHandler"
    	    CanExecute="CanPasteExecuteHandler" />
        <CommandBinding
    	    Command="ApplicationCommands.Delete"
    	    Executed="DeleteCommandHandler"
    	    CanExecute="CanDeleteExecuteHandler" />
        <CommandBinding
    	    Command="my:Command.OpenResult"
    	    Executed="OpenResultCommandHandler"
    	    CanExecute="CanOpenResultExecuteHandler" />
        <CommandBinding
    	    Command="my:Command.OpenFileLocation"
    	    Executed="OpenFileLocationCommandHandler"
    	    CanExecute="CanOpenFileLocationExecuteHandler" />
        <CommandBinding
            Command="Refresh"
            Executed="RefreshCommandHandler"
            CanExecute="CanRefreshExecuteHandler" />
    </ListBox.CommandBindings>
    <ListBox.ContextMenu>
        <ContextMenu Name="context" DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}">
            <MenuItem Header="Cut" Command="ApplicationCommands.Cut" ><!--Click="MenuItem_Cut_Click" >-->
                <!--<MenuItem.Icon>
                        <Image Source="Images/cut.png" />
                    </MenuItem.Icon>-->
            </MenuItem>
            <MenuItem Header="Copy" Command="ApplicationCommands.Copy" ><!--Click="MenuItem_Copy_Click" >-->
                <!--<MenuItem.Icon>
                        <Image Source="Images/copy.png" />
                    </MenuItem.Icon>-->
            </MenuItem>
            <MenuItem Header="Paste" Command="ApplicationCommands.Paste" ><!--Click="MenuItem_Paste_Click">-->
                <!--<MenuItem.Icon>
                        <Image Source="Images/paste.png" />
                    </MenuItem.Icon>-->
            </MenuItem>
            <MenuItem Header="Delete" Command="ApplicationCommands.Delete" /><!--Click="MenuItem_Delete_Click" />-->
            <Separator/>
            <MenuItem Header="Open Result" Command="my:Command.OpenResult"/><!--Click="MenuItem_Refresh_Click" />-->
            <MenuItem Header="Open File Location" Command="my:Command.OpenFileLocation" />
            <Separator/>
            <MenuItem Header="Refresh" Command="Refresh"/>
            <MenuItem Header="Properties" Command="ApplicationCommands.Properties"/><!--Click="MenuItem_Properties_Click" />-->
        </ContextMenu>
    </ListBox.ContextMenu>
    <!--<Grid>
        <ListBox Name="listbox1" ItemsSource="{Binding Source={StaticResource SortedItems}}" DisplayMemberPath="Name" SelectionMode="Extended">
            <ListBox.GroupStyle>
                <x:Static Member="GroupStyle.Default"/>
            </ListBox.GroupStyle>
        </ListBox>
    </Grid>-->
</ListBox>